import requests
import getpass
import os
import json

VAULT_URL = 'https://laksa.joomo.io:8200/v1/dex_key_high/data/'


def get_private_key(key_path: str):
    token = getpass.getpass(prompt='vault token: ')
    headers = {
        'X-Vault-Token': token,
    }
    response = requests.get(
        url=os.path.join(VAULT_URL, key_path),
        headers=headers
    )
    j = json.loads(response.text)
    return j['data']['data']
